package com.hospital.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.hospital.entity.Treatment;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

@Mapper
public interface TreatmentMapper {
    @Select("SELECT * FROM treatment WHERE dept_id = #{deptId} ORDER BY RAND() LIMIT 1")
    Treatment getRandomTreatmentByDeptId(Long deptId);

    @Select("SELECT * FROM treatment WHERE treatment_id = #{treatmentId}")
    Treatment selectById(Long treatmentId);
}
